import request from "@/utils/request";


export const findByPage = (data) => {
  return request({
    url: "/admin/system/sysRole/findByPage",
    method: "post",
    data:data
  });
};

export const saveOrUpdate = (data) => {
  return request({
    url: "/admin/system/sysRole/saveOrUpdate",
    method: "post",
    data:data
  });
};

export const batchDelete = (data) => {
  return request({
    url: "/admin/system/sysRole/batchDelete",
    method: "delete",
    data:data
  });
};


export const findById = (id) => {
  return request({
    url: `/admin/system/sysRole/findById/${id}`,
    method: "get"
  });
};

export const allRole = (userId) => {
  return request({
    url: `/admin/system/sysRole/allRoles/${userId}`,
    method: "get"
  });
};


export const assigningRoles = (data) => {
  return request({
    url: "/admin/system/sysRole/assigningRoles",
    method: "post",
    data:data
  });
};

export const assigningMenus = (data) => {
  return request({
    url: "/admin/system/sysRole/assigningMenus",
    method: "post",
    data:data
  });
};



export const findMenuIdsByRoleId = (roleId) => {
  return request({
    url: `/admin/system/sysRole/findMenuIdsByRoleId/${roleId}`,
    method: "get"
  });
};







